// Copyright Leonid Shlyapnikov 2010
// Distributed under the GNU Lesser General Public License http://www.gnu.org/licenses/lgpl.html
//    author: Leonid Shlyapnikov, created on: Feb 1, 2010

#include "./Base.h"

#include <boost/exception/all.hpp>
#include <exception>

#include "./log.h"

namespace fixparser {

void
Base::operator delete(void*, size_t size) {
    LOG_ERROR("Base::operator delete called");
    BOOST_THROW_EXCEPTION(std::runtime_error("Hidden!"));
}

void*
Base::operator new(size_t) {
    LOG_ERROR("Base::operator new called");
    BOOST_THROW_EXCEPTION(std::runtime_error("Hidden, use MemoryArea::create method!"));
}

void*
Base::operator new[](size_t) {
    LOG_ERROR("Base::operator new[] called");
    BOOST_THROW_EXCEPTION(std::runtime_error("Hidden, use MemoryArea::create method!"));
}

void
Base::operator delete[](void* dummy) {
    LOG_ERROR("Base::operator delete[] called");
    BOOST_THROW_EXCEPTION(std::runtime_error("Hidden!"));
}

}
